package com.arturjaneczko.view.impl.clipboard._component;

import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTable;

import com.arturjaneczko.model.impl.EClipboardDataType;

public class ClipboardObjectView extends JPanel {
	
	public ClipboardObjectView(EClipboardDataType clipboardDataType) {
		super();
		this.setLayout(new FlowLayout(FlowLayout.LEFT));
		this.setBackground(Color.WHITE);
		this.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 0, Color.white));
		
//		this.add(new ClipboardObjectTypeView(clipboardDataType));
//		this.add(new ClipboardObjectIconView(clipboardDataType));
		this.add(new ClipboardObjectPreviewView(clipboardDataType));
	}
	
	public void update(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		if (isSelected) {
			this.setBackground(table.getSelectionBackground());
		} else {
			this.setBackground(table.getSelectionForeground());
		}
	}
}
